﻿using ShiQuan.Unity;
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ShiQuan.DataAccess;

namespace ShiQuan.UnityTest
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
            UnityHelper unity = UnityHelper.Instance;

            IDatabase sqlserver = unity.GetResolve<IDatabase>("SqlServer");
            Assert.AreEqual(sqlserver.Name, "SqlDataBase");
        }
        [TestMethod]
        public void TestMethod2()
        {
            UnityHelper unity = UnityHelper.Instance;

            IDatabase mysql = unity.GetResolve<IDatabase>("MySql");
            Assert.AreEqual(mysql.Name, "MySqlDataBase");
        }
        [TestMethod]
        public void TestMethod3()
        {
            UnityHelper unity = UnityHelper.Instance;
            /*未能实现，测试不通过*/
            IDatabase oracle = unity.GetResolve<IDatabase>("Oracle");
            Assert.AreEqual(oracle.Name, "OracleDataBase");
        }
    }
}
